<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>


  <script>
    function F(a) {
      this.age = a
    }
    F.prototype.name = '张三'
    let f = new F(18)

    // console.log(f.hasOwnProperty('name')); //输出false
    // console.log(f.hasOwnProperty('age')); //输出true

    // console.log(f.__proto__);
    // console.log(f.constructor);
    // 以上两个都指向构造函数
    // console.log(f.name); //输出张三
    // F.prototype.name = '李四'

    delete f.age;
    console.log(f.age); // undefined

    delete f.name;
    console.log(f.name); // 'BetterMan'





  </script>
</body>

</html>